# Maintainer: Bradley Saulteaux <-@bradso.to>
pkgname=bluez-alsa
pkgver=2.1.0
pkgrel=1
pkgdesc="Bluetooth Audio ALSA Backend"
url="https://github.com/Arkq/bluez-alsa"
arch="all"
license="MIT"
depends="bluez"
subpackages="$pkgname-openrc"
makedepends="automake autoconf libtool alsa-lib-dev bluez-dev glib-dev sbc-dev
	dbus-dev fdk-aac-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/Arkq/bluez-alsa/archive/v$pkgver.tar.gz
	bluealsa.initd
	"

prepare() {
	default_prepare
	autoreconf --install
	mkdir build
}

build() {
	cd build
	../configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--enable-aac \
		--enable-ofono \
		--disable-static
	make
}

check() {
	cd build
	make check
}

package() {
	cd build
	make DESTDIR="$pkgdir" install
	install -Dm755 ../../bluealsa.initd "$pkgdir"/etc/init.d/bluealsa
}
sha512sums="8b6d520f5733799b1c509052ac527377cbe5e0106b75180f783f83071246937b5dc7a22c2d27f3e9e331c52c74be59f3bc6d78caab97b41f06cfd6ed5191b584  bluez-alsa-2.1.0.tar.gz
7952c75a47ef8bbbd9ea7c8f16e62ff6355db4011a4c3a7c9d084c740cebde945bb443a987169a8e314d422958288fd02704a25d28c9770fcb8a2c050530ab26  bluealsa.initd"
